package com.peycard.persistence.entities;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * The persistent class for the ADSYSUSER database table.
 * 
 */
@Entity
@Table(name="ADSYSUSER")
@NamedQueries({
@NamedQuery(name="findAdsysuserByName", query="SELECT u FROM Adsysuser u JOIN FETCH u.catalogRole WHERE u.user = :name"),
@NamedQuery(name="findAdsysuserByEmail", query="SELECT u FROM Adsysuser u WHERE u.email = :email "),
@NamedQuery(name="getUsers", query="SELECT u FROM Adsysuser u")
})
public class Adsysuser implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ID_ADSYSUS_GENERATOR", sequenceName="ID_ADSYSUS_GENERATOR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ID_ADSYSUS_GENERATOR")
	@Column(name="ID_ADMIN_SYS_USER")
	private long idAdminSysUser;

	@Column(name="ACCESS_FIRST")
	private int accessFirst;

	@Column(name="ANSWER_QUESTION")
	private String answerQuestion;

	@Column(name="FIRST_NAME")
	private String firstName;

	@Column(name="IS_ACTIVE")
	private int isActive;

	@Column(name="LAST_NAME")
	private String lastName;

	@Column(name="PASSWORD")
	private String password;

	@Column(name="SAVE_DATA")
	private Timestamp saveData;

	@Column(name="SECRET_QUESTION")
	private String secretQuestion;

	@Column(name="ASUSER")
	private String user;
	
	@Column(name="EMAIL")
	private String email;
	
	@Column(name="COMPANY")
	private String company;
	
	@Column(name="AREA")
	private String area;
	
	@Column(name="USERNAME")
	private String userName;

	//bi-directional many-to-one association to CatalogRole
    @ManyToOne
	@JoinColumn(name="ID_ROLE")
	private CatalogRole catalogRole;

	//bi-directional many-to-one association to PwdHistoricAdsy
	@OneToMany(mappedBy="adsysuser")
	private Set<PwdHistoricAdsy> pwdHistoricAdsys;

    public Adsysuser() {
    }

	public long getIdAdminSysUser() {
		return this.idAdminSysUser;
	}

	public void setIdAdminSysUser(long idAdminSysUser) {
		this.idAdminSysUser = idAdminSysUser;
	}

	public int getAccessFirst() {
		return this.accessFirst;
	}

	public void setAccessFirst(int accessFirst) {
		this.accessFirst = accessFirst;
	}

	public String getAnswerQuestion() {
		return this.answerQuestion;
	}

	public void setAnswerQuestion(String answerQuestion) {
		this.answerQuestion = answerQuestion;
	}
	
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public int getIsActive() {
		return this.isActive;
	}

	public void setIsActive(int isActive) {
		this.isActive = isActive;
	}

	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Timestamp getSaveData() {
		return this.saveData;
	}

	public void setSaveData(Timestamp saveData) {
		this.saveData = saveData;
	}

	public String getSecretQuestion() {
		return this.secretQuestion;
	}

	public void setSecretQuestion(String secretQuestion) {
		this.secretQuestion = secretQuestion;
	}

	public CatalogRole getCatalogRole() {
		return this.catalogRole;
	}

	public void setCatalogRole(CatalogRole catalogRole) {
		this.catalogRole = catalogRole;
	}
	
	public Set<PwdHistoricAdsy> getPwdHistoricAdsys() {
		return this.pwdHistoricAdsys;
	}

	public void setPwdHistoricAdsys(Set<PwdHistoricAdsy> pwdHistoricAdsys) {
		this.pwdHistoricAdsys = pwdHistoricAdsys;
	}

	/**
	 * @return el user
	 */
	public String getUser() {
		return user;
	}

	/**
	 * @param user el user a establecer
	 */
	public void setUser(String user) {
		this.user = user;
	}

	/**
	 * @return el email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email el email a establecer
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return el company
	 */
	public String getCompany() {
		return company;
	}

	/**
	 * @param company el company a establecer
	 */
	public void setCompany(String company) {
		this.company = company;
	}

	/**
	 * @return el area
	 */
	public String getArea() {
		return area;
	}

	/**
	 * @param area el area a establecer
	 */
	public void setArea(String area) {
		this.area = area;
	}

	/**
	 * @return el userName
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * @param userName el userName a establecer
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
}